<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="model.Pasta,dao.fabrica.FabricaDAO,dao.implementacao.jdbc.PastaJDBC, dao.assinatura.PastaDAO"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%String RAIZ = request.getContextPath(); %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="<%=RAIZ%>/bootstrap/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
    </style>
    <link href="<%=RAIZ%>/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="shortcut icon" href="<%=RAIZ%>/assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=RAIZ%>/bootstrap/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=RAIZ%>/bootstrap/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%=RAIZ%>/bootstrap/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<%=RAIZ%>/bootstrap/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
            <ul class="nav nav-list">
              <li class="active"><a href="<%=RAIZ%>/paginas/inicio.jsp">Inicio</a></li>
              
              <% 
                if (request.getParameter("p") != null)
 		     	{
  		     		int pastaID = Integer.parseInt(request.getParameter("p"));
  		     	
  		     		PastaDAO pastaDAO = FabricaDAO.createPasta();
  		     		Pasta pasta = pastaDAO.getPastaById(pastaID);
  		     		if (pasta != null) { %>
             
		              <li class="nav-header"><b>Pasta</b></li>
		              <%if (pasta.getId() > 0 ){ %><li><a href="<%=RAIZ%>/paginas/pasta.do?acao=verPasta&p=<%=pasta.getId()%>">Detalhes</a></li><%}%>
		              <%if (pasta.getIdAssistido() > 0 ){ %><li><a href="<%=RAIZ%>/paginas/pasta.do?acao=verAssistido&a=<%= pasta.getIdAssistido()%>">Assistido</a></li><%}%>
		              <%if (pasta.getIdTriagem() > 0 ){ %><li><a href="<%=RAIZ%>/paginas/pasta.do?acao=verTriagem&t=<%=pasta.getIdTriagem()%>">Triagem</a></li><%}%>   
		              <%if (pasta.getIdCaso() > 0 ){ %><li><a href="<%=RAIZ%>/paginas/pasta.do?acao=verCaso&c=<%=pasta.getIdCaso()%>">Caso</a></li><%}%>
              
              <% 	}
  		     	} %>
              
              <li class="nav-header">Listagem</li>
              <li><a href="<%=RAIZ%>/paginas/listagem.do?acao=verPastas">Pasta</a></li>
              <li><a href="<%=RAIZ%>/paginas/listagem.do?acao=verCasos">Caso</a></li>
              <li><a href="<%=RAIZ%>/paginas/listagem.do?acao=verTriagens">Triagem</a></li>
              <li><a href="<%=RAIZ%>/paginas/listagem.do?acao=verAssistidos">Assistido</a></li>
              <li><a href="<%=RAIZ%>/paginas/listagem.do?acao=verUsuarios">Usuario</a></li>

            </ul>

          <script src="<%=RAIZ%>/bootstrap/js/bootstrap.js"></script>
</body>
</html>